import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [//aaagit
  {
    path:'/',
    redirect:'/home/index',
    component: ()=>import ('@/views/Home/Home.vue'),
  },
  {
    path:'/cart',
    component: ()=>import ('@/views/Cart/Cart.vue'),
  },
  {
    path:'/my',
    component: ()=>import ('@/views/My/My.vue'),
  },
  // 我的注册
  {
    path:'/reg',
    name:'reg',
    component: ()=>import('@/views/My/reg.vue'),
  },
  
  // 我的登陆
  {
    path:'/login',
    name:'login',
    component: ()=>import('@/views/My/login.vue'),
  },
  //首页
  {
    path:'/home',
    component:()=>import('@/views/Home/Home.vue'),
    redirect:'/home/index',
    children:[
      {
        path:'/home/index',
        name:'index',
        component:()=>import('@/views/Home/index.vue'),
      },
      {
        path:'/home/speed',
        name:'speed',
        component:()=>import('@/views/Home/speed.vue'),
      },
      {
        path:'/home/mom',
        name:'speed',
        component:()=>import('@/views/Home/mom.vue'),
      },
      {
        path:'/home/qingshe',
        name:'speed',
        component:()=>import('@/views/Home/qingshe.vue'),
      },
      {
        path:'/home/mingpin',
        name:'speed',
        component:()=>import('@/views/Home/mingpin.vue'),
      },
    ]
  },
  //拼团
  {
    path:'/group',
    component: ()=>import ('@/views/Group/Group.vue'),
    redirect:'/group/tuijian',
    children:[
      {
        path:'/group/tuijian',
        name:'tuijian',
        component:()=>import ('@/views/Group/tuijian.vue'),
      },
      {
        path:'/group/beautiful',
        name:'beautiful',
        component:()=>import ('@/views/Group/beautiful.vue'),
      },
      {
        path:'/group/muying',
        name:'muying',
        component:()=>import ('@/views/Group/muying.vue'),
      },
      {
        path:'/group/next',
        name:'next',
        component:()=>import ('@/views/Group/next.vue'),
      },

    ]
  },
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
